﻿using UnityEngine;
using System.Collections;
using Memo.Electricity.Engine;

namespace Memo.Electricity.Game
{
	public class CGravelMgr : CBaseOrderBlockMgr
	{
		public float Speed { get => mSpeed; }

		[SerializeField]
		private float mSpeed;
		private CGravel[] mGravels;

		private void Awake()
		{
			mGravels = transform.GetComponentsInChildren<CGravel>();
		}

		private void OnEnable()
		{
			foreach (var g in mGravels)
			{
				RegisterOnce(g.Disabled, mSpeed * g.Order);
			}
		}
	}
}